<?php

namespace app\models;

use Yii;
use yii\db\ActiveRecord;

class Comment extends ActiveRecord
{
	function setCommet($data){
		/*
			采用第三方评论系统 弃
		*/
		exit;
		$model = new Comment();
		$model->article_id = $data['id'];
		$model->nickname = $data['nickname'];
		$model->email = $data['email'];
		$model->content = $data['content'];
		if($model->save()){
			return true;
		}else{
			return false;
		}
	}
	function getComment($id,$limit,$offset){
		/*
			采用第三方评论系统 弃
		*/
		exit;
		return $data = static::find()->where(['article_id'=>$id])->limit($limit)->offset($offset)->all();
	}
	function getCommentCount($id){
		/*
			采用第三方评论系统 弃
		*/
		exit;
		$data = static::find()->where(['article_id'=>$id])->count();
		return $data;
	}
}